<template>
  <div>

 <van-nav-bar
      title=""
      left-text="返回"
      left-arrow
      @click="onClickLeft"
    />
<div>{{ data }}</div>

  </div>
</template>
<script setup lang='ts'>
const onClickLeft = () => history.back();
import { ref,} from 'vue';
import axios from 'axios';
import { useRoute } from 'vue-router';

// 获取当前路由信息
const route = useRoute();
const id = route.params.id;


// 用于存储详情数据的响应式数据
// const detailData = ref({});

// 获取详情数据的函数
// const getDetailData = async () => {
//     try {
//         const response = await axios.get(`/api/detail/${id}`);
//         console.log(response)
//         detailData.value = response.data;
//     } catch (error) {
//         console.error('获取详情数据出错:', error);
//     }
// };
// getDetailData()


const data = ref([])
const getData = async () => {
  await axios.get(`/api/detail/${id}`).then(res => {
    console.log(res)
    data.value = res.data.data
    // console.log(date.value, 'date')
  })
}
getData()


</script>


<style >



</style>